﻿namespace languageSite.ViewModels.Common
{
    public class ResModel
    {
        public int state { get; set; } = 1000;
        public object data { get; set; }
        public string detail { get; set; }

        public static ResModel Success()
        {
            return new ResModel() { detail = "成功" };
        }
        public static ResModel Fail()
        {
            return new ResModel() { state = 1001, detail = "失败" };
        }
        public static ResModel Fail(string detail)
        {
            return new ResModel() { state = 1001, detail = detail };
        }
    }

    public class ResModel<T>
    {
        public int state { get; set; } = 1000;
        public T data { get; set; }
        public string detail { get; set; }
    }
}
